docs(memgql): cache attribute requirement + element ids as properties - #1706
Open
DavIvek wants to merge 5 commits into
Open
docs(memgql): cache attribute requirement + element ids as properties#1706DavIvek wants to merge 5 commits into
DavIvek wants to merge 5 commits into
Conversation
Two user-visible changes from the cache and ClickHouse fixes in memgraph/zero#71, plus the changelog entry for that work. Caching now needs every cached label to declare `attributes`. The cache copies only the columns the mapping names, so a label declaring none would be cached id-only and every property read back would be NULL; MemGQL declines to cache rather than serve those rows. This is the one thing that tripped an external reporter whose mapping was otherwise correct, so it is documented both where caching is set up and next to the existing routing note in the schema-file reference, which already covers the parallel "declared attributes required" rule. `metaFields.id` is now exposed as a property on vertices and edges, so `RETURN n` includes it and `n.<id_column>` reads it by name. Also replaces the note claiming the cache is validated only against Iceberg: it now runs in CI against six sources, and graph-native sources cannot be cached at all.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Rewrites the note added earlier in this branch. MemGQL no longer refuses to cache a label that declares no attributes — it caches its ids and topology, which is what traversals and graph algorithms run on, and treats a read of an undeclared property as a cache miss served from the source. Same rule routing applies, so the mapping format gains no obligation. Also documents the new `cached_properties` column on SHOW GRAPH CACHES, and corrects the claim that every `USE`-split part engages the cache independently: UNION composites dispatch as a whole and never consult it (memgraph/zero#75).
Catches the changelog up with two changes it was missing: SHOW GRAPH CACHES now reports `hits` / `misses` as well as `cached_properties`, and a warm table is no longer re-scanned from the source when a newly-touched edge type pulls it in as an endpoint. Also rewrites the cache-fidelity entry. It described the defect as "cached nodes carried only their id", which now reads as contradicting the behaviour change above it — caching a label id-only is supported. The defect was answering property reads out of a fragment that never held them.
DavIvek
marked this pull request as ready for review
July 31, 2026 13:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents two user-visible changes from the MemGQL cache and ClickHouse fixes in
memgraph/zero#71, and adds the changelog entry for that work.
What this documents
Caching now requires every cached label to declare
attributes. The cachecopies only the columns the mapping names, so a label declaring none would land
in Memgraph carrying nothing but its id, and every property read back would be
NULL. MemGQL declines to cache that graph rather than serve property-strippedrows, and names the label to fix; the query still runs against the source.
This is the one thing that tripped an external reporter whose mapping was
otherwise correct — the
attributes-are-optional rule holds for querying butnot for caching, and nothing said so. It is documented in both places a reader
would look: the caching how-to, and next to the existing "routing needs declared
attributes" note in the schema-file reference, which is the same class of rule.
metaFields.idis now exposed as a property on vertices and edges, soRETURN n/RETURN rinclude it andn.<id_column>reads it by name. BothmetaFieldstables say so.The cache's validation note was stale. It claimed the cache was "currently
validated with Iceberg sources; the mechanism generalizes to the other warehouse
connectors". It now runs in CI against PostgreSQL, MySQL, DuckDB, SQL Server,
ClickHouse and the native Iceberg connector — each replaying the same query
corpus from its cache that it runs against the source. The note also now states
that graph-native sources cannot be cached, which was never written down.
Changelog
A new
## Unreleasedsection covering the behaviour changes above plus thefixes: ClickHouse's alphabetical column ordering, the cache dropping edges and
properties,
count(DISTINCT <node>)and whole-elementWITH n, count(…)emitting invalid SQL, and the warm-up log counting rows read rather than written.